from tortoise import fields, models

class ElectricPriceInfo(models.Model):
    price_id = fields.IntField(pk=True)
    period_unit = fields.CharField(max_length=20, description="划分周期单位")
    period = fields.IntField(description="划分周期")
    price_type = fields.IntField(description="电价类型0：光电，1：水电，2：国网")
    granularity = fields.IntField(description="划分粒度")
    price_name = fields.CharField(max_length=20, description="电价名称")
    background = fields.CharField(max_length=100, description="背景",null=True)
    icon = fields.TextField(description="图标", null=True)

    class Meta:
        table = "electric_price_info"

    def __str__(self):
        return self.price_type